﻿<%

'先定义

Dim Site_ID		
Dim Site_Name	
Dim Site_Logo	
	
Dim Site_Url	
Dim Link_Type	

Dim Site_Order	
Dim Site_Flag	

Dim Update_Name	
Dim Update_Date	


Sub Get_Data()
	Site_Name = reform("Site_Name")
	Site_Logo = reform("Site_Logo")
	Site_Url = reform("Site_Url")	
	
	Link_Type = reform("Link_Type")
	
	Site_Order = reform("Site_Order")
	Site_Flag = reform("Site_Flag")


End Sub 

Sub Friend_Link_Add()	

	Update_Name		= Session("Admin_UserName")
	Update_Date		= now()

	
	Call Get_Data()

	sql = "INSERT INTO friend_link( " &_

		"Site_Name"&_
		",Site_Logo"&_

		",Site_Url"&_
		",Link_Type"&_

		",Site_Order"&_
		",Site_Flag"&_

		",Update_Name"&_
		",Update_Date"&_

		") VALUES( " &_
		
		"'"&Site_Name&"'"&_
		",'"&Site_Logo&"'"&_

		",'"&Site_Url&"'"&_
		","&Link_Type&""&_
		
		","&Site_Order&""&_
		","&Site_Flag&""&_

		",'"&Update_Name&"'"&_
		",'"&Update_Date&"'"&_
		")"
    conn.execute(sql)


	AlertBox "增加成功！","friend_link_Query.asp"


End Sub

Sub friend_link_Edit()	

	Update_Name		= Session("Admin_UserName")
	Update_Date		= now()

	Site_ID	 = reform("Site_ID")
	Call Check_IsNumeric(Site_ID)

	Call Get_Data()

	sql = "UPDATE friend_link Set " &_			 

		  " Site_Name ='"&Site_Name&"'"&_

		  ",Site_Logo ='"&Site_Logo&"'"&_

		  ",Site_Url ='"&Site_Url&"'"&_
		  ",Link_Type ="&Link_Type&_

		  ",Site_Order="&Site_Order&_
		  ",Site_Flag ="&Site_Flag&_

		  ",Update_Name ='"&Update_Name&"'"&_
		  ",Update_Date ='"&Update_Date&"'"&_
		  " WHERE Site_ID = "&Site_ID

    conn.execute(sql)

	AlertBox "修改成功！","friend_link_Query.asp"

End Sub

Sub friend_link_Del()


	Site_ID = reform("OP_ID")
	

	sql = "DELETE FROM  friend_link WHERE Site_ID IN( "&Site_ID &")"

    conn.execute(sql)

	AlertBox "删除成功！","friend_link_Query.asp"
	
End Sub

Sub friend_link_Info(Site_ID)

	Call Check_IsNumeric(Site_ID)


	sql = "SELECT * FROM friend_link WHERE Site_ID = " &Site_ID
	
	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		Site_Name	= rs("Site_Name")
		Site_Logo	= rs("Site_Logo")
		
		Site_Url	= rs("Site_Url")
		Link_Type	= rs("Link_Type")

		Site_Order	= rs("Site_Order")
		Site_Flag	= rs("Site_Flag")

	End If

	Set rs = Nothing 

End Sub 
%>


